#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QueryPerformanceFrequency (&fre);
    freDouble = fre.QuadPart;
    QueryPerformanceCounter(&cou);
    time.start();
    m1=cou.QuadPart;
}




MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{

       int time1, time2 , time3;
        QueryPerformanceCounter(&cou);
       time1 = time.elapsed();
//       time2 = (cou.QuadPart - m1) / fre.QuadPart * 1000;
       time3 = (cou.QuadPart - m1) / freDouble * 1000;
       qDebug()<<"QTime    : " << time1;
       qDebug()<<"win      : " << time2;
       qDebug()<<"winDouble: " << time3;

}

void MainWindow::on_pushButton_2_clicked()
{
    QueryPerformanceCounter(&cou);
    time.restart();
    m1 = cou.QuadPart;
}
